package com.toocms.jinjuhang.ui.mine.order

enum class OrderStatus(val code: Int) {
    ALL(-1), //全部
    AWAIT_PAYMENT(1), //待支付
    AWAIT_SHIPMENTS(2), //待发货
    AWAIT_RECEIVING(3), //待收货
    AWAIT_EVALUATE(4), //待评价
    AFTER_SALE(7); //售后

    companion object {
        fun code2Status(code: Int) = when (code) {
            ALL.code -> ALL
            AWAIT_PAYMENT.code -> AWAIT_PAYMENT
            AWAIT_SHIPMENTS.code -> AWAIT_SHIPMENTS
            AWAIT_RECEIVING.code -> AWAIT_RECEIVING
            AWAIT_EVALUATE.code -> AWAIT_EVALUATE
            AFTER_SALE.code -> AFTER_SALE
            else -> ALL
        }

    }
}